/*
 * =====================================================================================
 *
 *       Filename:  main_window.cpp
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  2009年04月08日 10时01分54秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  first_name last_name (fl), fl@my-company.com
 *        Company:  my-company
 *
 * =====================================================================================
 */

#include "main_window.h"

void on_logo_click(gpointer data)
{

	printf("button press\n");
}

void on_letter_click(gpointer data)
{
	printf("letter press\n");
}

void on_punct_click(gpointer data)
{
	printf("punct press\n");
}

MainWindow::MainWindow():window(NULL)
			 ,btn_logo(NULL)
			 ,btn_letter(NULL)
			 ,btn_punct(NULL)
{
	window = new class tWindow();
	window->create("fcitx+","./background.png");

	btn_logo= new class tButton();
	btn_logo->set_crood_xy(15,2);
	btn_logo->create_tbutton(window->get_fixed(),"./logo.png",on_logo_click,NULL);


	btn_letter = new class tButton();
	btn_letter->set_crood_xy(71,2);
	btn_letter->create_tbutton(window->get_fixed(),"./letter.png",on_letter_click,NULL);
	
	btn_punct = new class tButton();
	btn_punct->set_crood_xy(43,2);
	btn_punct->create_tbutton(window->get_fixed(), "./punct.png",on_punct_click,NULL);
}

MainWindow::~MainWindow()
{
	delete btn_logo;
	delete window;
	delete btn_letter;

}

int main(int argc, char *argv[])
{
	gtk_init(&argc,&argv);
	MainWindow* main_window = new class MainWindow();

	gtk_main();
	delete main_window;

	  return 0;
}

